<?php

if (isset($_POST['submit_invest']))
{
	$sc = @$_POST['shortcode'];
	$an = stripslashes(@$_POST['argname']);
	$ad = stripslashes(@$_POST['argdesc']);
	$pm = stripslashes(@$_POST['param']);
	$ex = stripslashes(@$_POST['example']);
	$url = stripslashes(@$_POST['url']);

	//need to create file.
	
	@session_start();
	$access_token = $_SESSION['access_token'];
	$suser = $access_token['user_id'];

	$a_n = $access_token['screen_name'];
	$a_u = "http://www.twitter.com/".$a_n;

	$topdir = "/home/boostpo1/public_html/chirplace.com/usr/".$suser."/scodes/".$an.".php";

	$fh = fopen($topdir, 'w');
	fwrite($fh, "<?php\n\r\$scodecode = \"$sc\";\n\r\$scodename = \"$an\";\n\r\$scodedesc = \"$ad\";\n\r\$scodeparam = \"$pm\";\n\r\$scodeexample = \"$ex\";\n\r\$scodeauthor = \"$a_n\";\n\r\$scodeauthorurl = \"$a_u\";\n\r\$scodemoduleurl = \"$url\";\n\r\$scoderetval = \"$url\";\n\r?>");
	fclose($fh);

}

header("Location:index.php");
?>